#!/usr/bin/python
n = 600851475143 
i = 2

while i * i < n:          #  Basic counter, but it ends when number * itself 													   exceeds n, we can also do sqrt of n
	while n % i == 0:
		n = n / i
	i = i + 1
print n
